module.exports = function () {
  this.log = function() {
    console.log.apply(null, arguments);
  };

  this.logg = function(prompt, data) {
    if (this.get('env') === 'development') {
      if (data) {
        console.log(`>>>> ${prompt} 开始`);
        try {
          console.log('类型：', typeof data);
          console.log(data);

          console.log('JSON.stringify');
          console.log(JSON.stringify(data));
        } catch (e) {
          console.log('可能存在递归引用，无法字符串化');
        }
        console.log(`<<<< ${prompt} 结束`);
      } else {
        console.log(prompt);
      }      
    }
  };
};
